#include <bits/stdc++.h>
using namespace std;

int r[100005];

int main()
{
	freopen("duel.in","r",stdin);
	freopen("duel.out","w",stdout);
	ios::sync_with_stdio(false);
	int n;
	cin >> n;
	int jsq = n;
	for(int i = 1; i <= n; i++)
	{
		cin >> r[i];
	}
	if(n % 2 == 0)
	{
		for(int i = 1; i <= n; i = i + 2)
		{
			if(r[i] != r[i + 1])
			{
				jsq--;	
			}
		}
		cout << jsq;
	}
	else if(n % 2 != 0)
		{
			for(int i = 1; i <= n; i= i + 2)
			
			{
				if(r[i] != r[i + 1])
				{
					jsq--;
				}
			}
			cout << jsq - 1;
		}
	fclose(stdin);
	fclose(stdout);
	return 0;
}
